package com.wwl.io;

import java.io.*;

public class DataInputStreamDemo {

    public static void main(String[] args) throws IOException {
        DataInputStream dis = new DataInputStream(new FileInputStream("bcd.txt"));
        DataOutputStream dos =new DataOutputStream(new FileOutputStream("bcd.txt"));

        dos.writeInt(22);
        dos.writeUTF("休.格兰特");

        int int1 = dis.readInt();
        String str= dis.readUTF();
        System.out.println("int="+int1);
        System.out.println("str="+str);
    }

}
